<template id="textSon">
    <div class="chat-input"><input type="text" placeholder="请输入消息..." v-model="newText"> <button
        @click="sonClick()">发送</button></div>
</template>

<script>
    export default{
        props: ['newText'],
        methods: {
            sonClick() {
            this.$emit("danji", this.newText)
            }
        }
    }
</script>

<style scoped>
.chat-input {
  display: flex;
  padding: 10px;
}

.chat-input input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-right: 10px;
}

.chat-input button {
  padding: 8px 15px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
</style>